<template>
  <div class="bgpage">
    <div class="header">
      <div class="back" @click="back()">&lt;</div>
      <div class="title">{{sonlist.serviceName}}</div>
    </div>
    <div class="main">
      <img :src="imgsrc" alt="" />
      <div class="sum dis">
        <p class="remain">余额</p>
        <p class="remain-m">XXX元</p>
      </div>
      <div class="pay">
        <div class="dis info">
          <div class="info-name">缴费户名</div>
          <input type="text" id="" class="text" placeholder="请输入户名" />
        </div>
        <div class="dis info">
          <div class="info-name">缴费户号</div>
          <input type="text" id="" class="text" placeholder="请输入户号" />
        </div>
        <div class="dis info">
          <div class="info-name">缴费单位</div>
          <input type="text" id="" class="text" placeholder="请输入缴费单位" />
        </div>
        <div class="dis info">
          <div class="info-name">地址</div>
          <input type="text" id="" class="text" placeholder="请输入地址" />
        </div>
      </div>
      <p class="fees">缴费金额</p>
      <div class="amount">
        <button>50元</button>
        <button>100元</button>
        <button>150元</button>
      </div>
      <div class="own">
        ￥<input type="text" class="much" id="" placeholder="请输入金额" />
      </div>
    </div>
    <div class="button" @click="put()">立即缴费</div>
  </div>
</template>

<script>
import {  mapActions,mapState } from 'vuex'
export default {
  data () {
    return {
      sonid: "",
      imgsrc:"",
    }
  },
  created () {
    this.show()
   
  },
  
  computed: {
    ...mapState("servelist",["sonlist"]),
    ...mapState("payment", ["list"]),
  },
  methods: {
    ...mapActions("servelist",["sonserve"]),
    show(){
      this.sonid = this.$route.params.id
      this.sonserve(this.sonid)
      let img = this.list.filter(item => item.id == this.sonid)[0]
      this.imgsrc = img.img
      console.log(this.imgsrc)
    },
    back(){
      this.$router.back()
    },
    put(){
      console.log(this.sonlist)
    }
  }
};
</script>

<style lang="scss" scoped>
.dis {
  display: flex;
  justify-content: space-between;
}
.bgpage {
  width: 3.75rem;
  background: #f7f7f7;
  .header {
    width: 3.75rem;
    height: 0.61rem;
    background: #16cebb;
    .back {
      width: 0.11rem;
      height: 0.11rem;
      // border: 0.02rem solid #333333;
      position: absolute;
      top: 0.17rem;
      left: 0.28rem;
      font-size: 0.2rem;
    }
    .title {
      font-size: 0.18rem;
      font-family: PingFangSC-Semibold, PingFang SC;
      font-weight: 600;
      color: #333333;
      display: flex;
      position: absolute;
      top: 0.16rem;
      left: 1.52rem;
    }
  }
  .main {
    margin-top: 0.54rem;
    margin-left: 0.22rem;
    width: 3.31rem;
    height: 5.59rem;
    background: #ffffff;
    border-radius: 0.1rem;
    box-sizing: border-box;
    padding: 0.4rem 0.16rem;
    img{
      width: 0.46rem;
      height: 0.46rem;
      position: absolute;
      top: 0.98rem;
      left: 1.65rem;
    }
    .sum {
      width: 100%;
      height: 0.42rem;
      border-bottom: 0.01rem solid #e6e6e6;
      .remain {
        width: 0.28rem;
        height: 0.2rem;
        font-size: 0.14rem;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #666666;
        line-height: 0.2rem;
      }
      .remain-m {
        width: 1.94rem;
        height: 0.25rem;
        font-size: 0.18rem;
        font-family: PingFangSC-Semibold, PingFang SC;
        font-weight: 600;
        color: #333330;
        line-height: 0.25rem;
      }
    }
    .pay {
      width: 100%;
      margin-bottom: 0.48rem;
      .info {
        width: 100%;
        margin-top: 0.27rem;
        .info-name {
          width: 0.56rem;
          height: 0.2rem;
          font-size: 0.14rem;
          font-family: PingFangSC-Regular, PingFang SC;
          font-weight: 400;
          color: #000000;
          line-height: 0.2rem;
        }
        .text {
          width: 1.94rem;
          height: 0.2rem;
          font-size: 0.14rem;
          font-family: PingFangSC-Regular, PingFang SC;
          font-weight: 400;
          line-height: 0.2rem;
          border: none;
          border-bottom: 0.01rem solid #e6e6e6;
        }
      }
    }
    .fees {
      font-size: 0.18rem;
      font-family: PingFangSC-Semibold, PingFang SC;
      font-weight: 600;
      color: #333333;
      line-height: 0.25rem;
    }
    .amount {
      margin-top: 0.38rem;
      width: 100%;
      display: flex;
      justify-content: space-between;
      button {
        width: 0.98rem;
        height: 0.36rem;
        background: #00d2bb;
        border: none;
        border-radius: 0.05rem;
        font-size: 0.14rem;
        font-family: PingFangSC-Semibold, PingFang SC;
        font-weight: 600;
        color: #ffffff;
      }
    }
    .own {
      width: 100%;
      margin-top: 0.35rem;
      font-size: 0.28rem;
      font-family: PingFangSC-Semibold, PingFang SC;
      font-weight: 600;
      color: #333333;
      display: flex;
      justify-content: space-between;
      border-bottom: 0.01rem solid #e6e6e6;
      padding-bottom: 0.08rem;
      .much {
        width: 2.7rem;
        font-size: 0.2rem;
        font-family: PingFangSC;
        color: #999999;
        line-height: 0.28rem;
        border: none;
      }
    }
  }
  .button {
    width: 2.4rem;
    height: 0.45rem;
    background: #00d2bb;
    border-radius: 0.23rem;
    font-size: 0.14rem;
    font-family: PingFangSC;
    color: #ffffff;
    line-height: 0.45rem;
    margin-top: 0.21rem;
    text-align: center;
    border: none;
    margin-left: 0.67rem;
  }
}
</style>
